<?php $this->headScript()->appendFile(HTTP_HOST.'/js/site-manager/special-offers.js'); ?>
<?php if (sizeof($this->offers) > 0) { ?>
<?php $i = 1;?>
<div id="cat_table_div">
<table id="cat_table">
	<tr class="head">
		<td class="checkbox_td"></td>
		<td><?=$this->translate('Код')?></td>
		<td></td>
		<td><?=$this->translate('Акции')?></td>
		<td class="active_td">-</td>
		<td colspan="2" class="right_angle"></td>
	</tr>
	<tr id="subhead">
		<td class="checkbox_td"><input type="checkbox" class="enable_all"></td>
		<td class="_table_code"><input type="text" name="code" id="code_field" maxlength="10"/></td>
		<td>-</td>
		<td><input type="text" name="search_region" id="search_region" maxlength="255"/></td>
		<td class="active_td">-</td>
		<td colspan="2" class="search_image"><img src="<?=HTTP_HOST; ?>/images/controll/zoom.png" alt="" class="zoom_icon"/></td>
	</tr>	
	<?php foreach ($this->offers as $v) { ?>
		<?php $i++;?>
		<tr class="cl" <?=(!is_int($i/2))?"style='background: #e1e0e0;'":""; ?>>
			<td class="checkbox_td"><input type="checkbox" name="<?=$v['ID']?>" class="news_ch"></td>
			<td class="_table_code"><?=$v['ID']?></td>
			<?php $id = $v['ID']; ?>
			<td class="type_td"><img src="<?=HTTP_HOST; ?>/images/controll/file.png" alt="" class="object_type" id="state-<?=$v['ID']?>"/></td>
			<td class="_table_title"><?=$v['Title']?></td>
			<td class="active_td"><img src="<?=HTTP_HOST; ?>/images/controll/<?=$v['active'] == 0 ? 'inactive.png' : 'active.png'?>" alt="" class="state" id="state-<?=$v['ID']?>" title="<?=$v['active'] == 0 ? $this->translate('Не активный') : $this->translate('Активный')?>"/></td>
			<td class="edit_td"><a href="<?=$this->url(array('controller' => 'special-offers', 'action' => 'edit', 'id' => $v['ID']), null, false)?>"><img src="<?=HTTP_HOST; ?>/images/controll/edit.png" alt="" class="ed-del-btn" title="<?=$this->translate('Редактировать акцию')?>"/></a></td>
			<td class="del_td"><div id="<?=$v['ID']?>" class="del_act" rel="<?=$v['Title']?>" ><img src="<?=HTTP_HOST; ?>/images/controll/delete.png" alt=""  class="ed-del-btn" title="<?=$this->translate('Удалить акцию')?>"/></div></td>
		</tr>
	<?php } ?>
	<tr class="table_footer cl">
		<td id="ch" class="checkbox_td"><input type="checkbox" class="enable_all"></td>
		<td colspan="6" id="footer_ico">
			<div id="group_delete">
				<img src="<?=HTTP_HOST; ?>/images/controll/delete.png" alt=""  class="ed-del-btn"/>
				<div id="delete_label"><?=$this->translate('Удалить')?></div>
			</div>
			<div id="table_paging_div"><?=$this->paginationControl($this->offers, 'Sliding', 'pagination.phtml'); ?></div>		
			<div id="_add_new_object_div"><a href="<?=$this->url(array('controller' => 'special-offers', 'action' => 'edit', 'addnew' => 1))?>"><img src="<?=HTTP_HOST;?>/images/admin-side/add.png" alt="" class="add_sign"/><?=$this->translate('Добавить акцию')?></a></div>
		</td>
	</tr>
</table>
<div id="table_shadow"></div>
</div>
<?php } else {?>
	<div id="_add_new_object_div"><a href="<?=$this->url(array('controller' => 'special-offers', 'action' => 'edit', 'addnew' => 1))?>"><img src="<?=HTTP_HOST;?>/images/admin-side/add.png" alt="" class="add_sign"/><?=$this->translate('Добавить акцию')?></a></div>
<?php }?>
